<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:b3mn="http://b3mn.org/2007/b3mn"
    xmlns:ext="http://b3mn.org/2007/ext"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
	xmlns:atom="http://b3mn.org/2007/atom+xhtml">
    <head profile="http://purl.org/NET/erdf/profile">
        <title>Diagram Editor</title>
		
        <!-- libraries -->
		<script src="../oryx/editor/libs.js" type="text/javascript" charset="utf-8"></script>
        
        <!-- compresed oryx files -->
        <script src="../oryx/editor/oryx.core.js" type="text/javascript" charset="utf-8"></script>
        <!-- for profile file see function loadJavaScriptForProfile below-->

        <style media="screen" type="text/css">
			@import url("../oryx/editor/lib/ext-2.0.2/resources/css/ext-all.css");
			@import url("../oryx/editor/lib/ext-2.0.2/resources/css/xtheme-gray.css"); 
			@import url("../oryx/editor/lib/jquery-ui-1.8.1.custom/css/ui-lightness/jquery-ui-1.8.1.custom.css");
		</style>
		
        <!-- oryx editor -->
        <link rel="Stylesheet" media="screen" href="../../oryx/editor/css/theme_norm.css" type="text/css" />
    </head>

    <body style="display: block; overflow: hidden;">
        <script type="text/javascript">
        <![CDATA[
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-26113902-1']);
            _gaq.push(['_trackPageview']);

            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
        ]]>
        </script>
        <script type='text/javascript'>
        <![CDATA[
            var ed;
            var stencilSetName = _getStencilSetName();
            loadJavaScriptForProfile();
			
            function loadJavaScriptForProfile() {
                var scriptTag = document.createElement('script');
                scriptTag.setAttribute("type","text/javascript");
                scriptTag.setAttribute("src", '../oryx/editor/profiles/' + stencilSetName + '.js');
                scriptTag.setAttribute("charset", "utf-8");
                document.getElementsByTagName("head")[0].appendChild(scriptTag);
            }

            function onOryxResourcesLoaded(){
                ed = new ORYX.Editor({
                  'id': 'oryx-canvas',
                  'stencilset': {
                    'url': ORYX.CONFIG.ROOT_PATH + 'editor/stencilsets/' + stencilSetName + '/' + stencilSetName + '.json'
                  }
                });
            }

            function _getStencilSetName() {
                if (stencilSetName) {
                    return stencilSetName;
                }

                stencilSetName = "bpmn2.0";
                var urlquery = location.href.split("?");
                if (urlquery[1]) {
                    var urlterms = urlquery[1].split(",");
                    for (var i = 0; i < urlterms.length; i++) {
                        if (urlterms[i].indexOf("stencilSetName=") == 0) {
                            stencilSetName = urlterms[i].slice("stencilSetName=".length);
                            break;
                        }
                    }
                }
                return stencilSetName;
            }
        ]]>
        </script>
    </body>
</html>
